// xc_lshop/wholesale/pro/com/cflist.js

var actbill = require('../../../../../xc/model/user_warehouse')
// var actorderbill = require('../../../../shop/model/order_inpuirybill')


Component({
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    show: false
  },

  /**
   * 组件的方法列表
   */
  methods: {
    init(proid) {
      this.setData({
        proid:proid
      })
      this.getlist(proid)
      this.getmylist(proid)
      // this.selectComponent("#mycflist").init(proid);
    },
    getmylist(proid) {
      var that = this;
      actbill.mylist(proid).then(function (result) {
       
        if (result['status'] == 1) {
          var myshow = false
          if (result['obj'].length > 0) {
            myshow = true
          }

          that.setData({
            myshow: myshow,
            mymodellist: result['obj']
          })
        }
      })
    },
    getlist(proid) {

      var that = this;
      actbill.salelist(proid).then(function (result) {
        if (result['status'] == 1) {
          var show = false
          if (result['obj'].length > 0) {
            show = true
          }

          console.log(result['obj'])
          that.setData({
            show: show,
            modellist: result['obj']
          })
        }
      })
    },
    showmore(e) {
      console.log(e)
      console.log(e)
      var list=e.currentTarget.dataset.list

      this.selectComponent("#allcflist").init(list)
    }
  }
})